import request from '@/plugins/request';
// 内容列表
export function contentList(data) {
    return request({
      url: "/v1/buss/content/list",
      method: "get",
      params: data,
    });
}
  
  //新增内容
export function createContent(data) {
    return request({
        url: "/v1/buss/content/create",
        method: "post",
        data,
    });
}

//删除内容
export function deleteContent(data) {
    return request({
        url: "/v1/buss/content/delete",
        method: "post",
        data,
    });
}

// 内容详情
export function contentInfo(data) {
    return request({
      url: "/v1/buss/content/info",
      method: "get",
      params: data,
    });
}
  
//编辑内容
export function updateContent(data) {
    return request({
        url: "/v1/buss/content/update",
        method: "post",
        data,
    });
}

// 用户筛选列表
export function contentCondition(data) {
    return request({
      url: "/v1/buss/content/list-condition",
      method: "get",
      params: data,
    });
}
// 发布内容列表
export function publishList(data) {
    return request({
      url: "/v1/buss/content/publish-list",
      method: "get",
      params: data,
    });
}
// 发布获取筛选详情
export function publishInfo(data) {
    return request({
      url: "/v1/buss/content/publish-info",
      method: "get",
      params: data,
    });
}
 // 根据医生返回账号列表
export function doctorAccountList(data) {
    return request({
      url: "/v1/buss/content/doctor-account-list",
      method: "get",
      params: data,
    });
} 
//发布内容
export function createPublish(data) {
    return request({
        url: "/v1/buss/content-publish/create",
        method: "post",
        data,
    });
}

 // 下载内容详情
 export function downloadInfo(data) {
    return request({
      url: "/v1/buss/content/download-info",
      method: "get",
      params: data,
    });
} 
 // 内容详情下载
 export function contentDownload(data) {
    return request({
      url: "/v1/buss/content/download",
      method: "get",
      params: data,
    });
} 

//上传文件
export function uploadFile(data,that) {
  return request({
      url: "/common/file/upload",
      method: "post",
      isUpload:true,
      data, 
      signal:that.controller.signal,
      onUploadProgress:function(e){
        that.progress=parseInt(e.loaded/e.total*100) 
      }
  });
}
